<style type="text/css">
* { margin:0; padding:0; }
img { margin:0; padding:0; border:0; }
#js_F {
  position:relative;
  top:0px; left:10px;
  overflow:hidden;
  width:<{$setting.width|default:100}>px; height:<{$setting.height|default:100}>px;
  background:#33c;
}
#js_F img{
  position:absolute;
  top:0; left:0;
  
}
</style>
<div id="js_F"></div>
<script type="text/javascript">
var js_F = document.getElementById("js_F");
var imgList=Array();
<{foreach from=$data item=data key=key}>
imgList.push('<{$data.link}>');

<{/foreach}>

var imgTemp = new Array();
for (i=0; i<imgList.length; i++){
  imgTemp[i] = new Image();
  imgTemp[i].src = imgList[i];
}
var imgs = new Array();
var imgID = 0, nextImgID, proveImgID;
var tf = true; 
var speed1 = 10 , speed2 = 3000; 
function imgInit(){
  var content = '';
  for (i=0; i<imgList.length; i++){
    content += '<img src="' + imgList[i] + '" style="left:0;" />\n';
  }
  js_F.innerHTML = content;
  imgs = js_F.getElementsByTagName('img');
  imgs[0].style.zIndex = 20;
  imgs[1].style.zIndex = 15;
}
function imgChange(){
  if ((imgID+1)<imgList.length){
    nextImgID = imgID + 1;
  } else if (imgID<imgList.length) {
    nextImgID = 0;
  } else {
    imgID = 0;
    nextImgID = imgID + 1;
  }
  imgs[imgID].style.zIndex = 20;
  imgs[nextImgID].style.zIndex = 15;
  setTimeout('imgShow()',speed2);
}
function imgShow(){
  if (tf){ 
    if (parseInt(imgs[imgID].style.left)>-180){
      imgs[imgID].style.left = (parseInt(imgs[imgID].style.left)-10) + 'px';
      imgs[nextImgID].style.left = (parseInt(imgs[nextImgID].style.left)+5) + 'px';
      setTimeout('imgShow()',speed1);
    } else {
      tf = !tf;
      imgs[imgID].style.zIndex = 15;
      imgs[nextImgID].style.zIndex = 20;
      setTimeout('imgShow()',speed1);
    }
  } else {
    if (parseInt(imgs[imgID].style.left)<0){
      imgs[imgID].style.left = (parseInt(imgs[imgID].style.left)+10) + 'px';
      imgs[nextImgID].style.left = (parseInt(imgs[nextImgID].style.left)-5) + 'px';
      setTimeout('imgShow()',speed1);
    } else {
      imgs[imgID].style.zIndex = 10;
      tf = !tf;
      imgID++;
      imgChange();
    }
  }
}
imgInit();
imgChange();

</script>